﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using GoGrid;
using System.Net;

namespace Readify.Management.Automation.GoGrid
{
    public class GoGridCmdletBase : Cmdlet
    {
        [Parameter(Mandatory = true)]
        public PSCredential Credential { get; set; }

        protected Connection GetConnection()
        {
            NetworkCredential credential = this.Credential.GetNetworkCredential();
            Connection connection = new Connection(credential.UserName, credential.Password);
            return connection;
        }
    }
}
